﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Threading;

namespace TempDataInterfaceDLL
{
    public partial class TempDataInterface
    {
        void Combination()
        {
            try
            {
                for (int i = 0; i < CombinationThreadCount; i++)
                {
                    CombinationThreadWorked[i] = false;
                    CombinationFirst[i] = true;
                    CombinationThreadIsWork[i] = false;
                    CombinationDataList[i] = new CombinationData();
                    saveOldTempData[i] = null;
                }
                Hashtable DecimalCalls1 = new Hashtable();
                foreach (DictionaryEntry de in DecimalCalls)
                {
                    List<CallData> decimalCalls = (List<CallData>)de.Value;
                    if (decimalCalls.Count != 0)
                    {
                        bool bCombo = false;
                        while (true)
                        {
                            for (int i = 0; i < CombinationThreadCount; i++)
                            {
                                if (!CombinationThreadWorked[i])
                                {
                                    if (CombinationThreadIsWork[i])
                                    {
                                        if (CombinationDataList[i].decimalCalls != null)
                                            DecimalCalls1[CombinationDataList[i].caller] = CombinationDataList[i].decimalCalls.ToList<CallData>();
                                        if (CombinationDataList[i].intCalls != null)
                                            IntCalls[CombinationDataList[i].caller] = CombinationDataList[i].intCalls.ToList<CallData>();
                                        else
                                        {
                                            if (IntCalls[CombinationDataList[i].caller] != null)
                                            {
                                                IntCalls.Remove(CombinationDataList[i].caller);
                                            }
                                        }
                                        if (CombinationDataList[i].noticeCalls != null)
                                            NoticeCalls[CombinationDataList[i].caller] = CombinationDataList[i].noticeCalls.ToList<CallData>();
                                        else
                                        {
                                            if (NoticeCalls[CombinationDataList[i].caller] != null)
                                                NoticeCalls.Remove(CombinationDataList[i].caller);
                                        }
                                        if (saveOldTempData[i] != null)
                                        {
                                            OldTempDataDBOption.SavwOldTemp(saveOldTempData[i]);
                                        }
                                        CombinationThreadIsWork[i] = false;
                                    }
                                    ConbinationThreadIns[i] = new Thread(new ParameterizedThreadStart(ConbinationProc));
                                    ConbinationThreadIns[i].Name = (i + 1).ToString() + "线程组合数据";
                                    //ShowTextLogProc((i + 1).ToString() + "线程获取数据");
                                    CombinationDataList[i].caller = (string)de.Key;
                                    CombinationDataList[i].decimalCalls = new CallData[decimalCalls.Count];
                                    decimalCalls.CopyTo(CombinationDataList[i].decimalCalls);
                                    List<CallData> l = (List<CallData>)IntCalls[CombinationDataList[i].caller];
                                    if (l != null)
                                    {
                                        CombinationDataList[i].intCalls = new CallData[l.Count];
                                        l.CopyTo(CombinationDataList[i].intCalls);
                                    }
                                    else
                                        CombinationDataList[i].intCalls = null;
                                    l = (List<CallData>)NoticeCalls[CombinationDataList[i].caller];
                                    if (l != null)
                                    {
                                        CombinationDataList[i].noticeCalls = new CallData[l.Count];
                                        l.CopyTo(CombinationDataList[i].noticeCalls);
                                    }
                                    else
                                        CombinationDataList[i].noticeCalls = null;
                                    CombinationDataList[i].index = i;
                                    CombinationFirst[i] = false;
                                    CombinationThreadIsWork[i] = true;
                                    saveOldTempData[i] = null;
                                    curOldTempData[i] = OldTempDataDBOption.GetOldTemp(CombinationDataList[i].caller);
                                    ConbinationThreadIns[i].Start(i);
                                    CombinationThreadWorked[i] = true;
                                    bCombo = true;
                                    break;
                                }
                            }
                            if (bCombo)
                                break;
                        }
                    }
                }
                bool bfinish = false;
                while (!bfinish)
                {
                    bfinish = true;
                    for (int i = 0; i < CombinationThreadCount; i++)
                    {
                        if (CombinationThreadWorked[i])
                        {
                            bfinish = false;
                        }
                    }
                }
                for (int i = 0; i < CombinationThreadCount; i++)
                {
                    if (CombinationThreadIsWork[i])
                    {
                        if (CombinationDataList[i].decimalCalls != null)
                            DecimalCalls1[CombinationDataList[i].caller] = CombinationDataList[i].decimalCalls.ToList<CallData>();
                        if (CombinationDataList[i].intCalls != null)
                            IntCalls[CombinationDataList[i].caller] = CombinationDataList[i].intCalls.ToList<CallData>();
                        else
                        {
                            if (IntCalls[CombinationDataList[i].caller] != null)
                            {
                                IntCalls.Remove(CombinationDataList[i].caller);
                            }
                        }
                        if (CombinationDataList[i].noticeCalls != null)
                            NoticeCalls[CombinationDataList[i].caller] = CombinationDataList[i].noticeCalls.ToList<CallData>();
                        else
                        {
                            if (NoticeCalls[CombinationDataList[i].caller] != null)
                                NoticeCalls.Remove(CombinationDataList[i].caller);
                        }
                        if (saveOldTempData[i] != null)
                        {
                            OldTempDataDBOption.SavwOldTemp(saveOldTempData[i]);
                        }
                        CombinationThreadIsWork[i] = false;
                    }
                }
                DecimalCalls = new Hashtable();
                foreach (DictionaryEntry de in DecimalCalls1)
                {
                    DecimalCalls[de.Key] = de.Value;
                }
                ShowTextLogProc("检查整数容错:" + FirstIntCheckTime.AddSeconds(-400).ToString(), 0);
                foreach (DictionaryEntry de in IntCalls)
                {
                    List<CallData> intCalls = (List<CallData>)de.Value;
                    if (intCalls.Count != 0)
                    {
                        CheckIntCall(ref intCalls, FirstIntCheckTime.AddSeconds(-400), 0, false);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ShowTextLogProc("合并数据主线程发生重要错误" + ex.Message, 0);
            }
        }
        private void ConbinationProc(object data)
        {
            try
            {
                int CombinationDataIndex = (int)data;
                StringBuilder sb;
                List<CallData> decimalCalls = CombinationDataList[CombinationDataIndex].decimalCalls.ToList<CallData>();
                List<CallData> intCalls;
                if (CombinationDataList[CombinationDataIndex].intCalls != null)
                    intCalls = CombinationDataList[CombinationDataIndex].intCalls.ToList<CallData>();
                else
                    intCalls = null;
                List<CallData> noticeCalls;
                if (CombinationDataList[CombinationDataIndex].noticeCalls != null)
                    noticeCalls = CombinationDataList[CombinationDataIndex].noticeCalls.ToList<CallData>();
                else
                    noticeCalls = null;
                int index;
                while (decimalCalls.Count != 0)
                {
                    index = GetEarlyDecamal(decimalCalls);
                    CallData decimalCall = decimalCalls[index];
                    bool bSave = false;
                    if (intCalls != null)//已经有了整数温度
                    {
                        //组合温度
                        for (int k = 0; k < intCalls.Count; k++)
                        {
                            CallData intCall = intCalls[k];
                            //小数温度点的时间应位于整数温度点的时间之后的400s内
                            if (intCall.callin_time < decimalCall.callin_time)
                            {
                                if (intCall.callin_time.AddSeconds(400) > decimalCall.callin_time)
                                {
                                    //合并温度
                                    float t = intCall.UserIndex + 11;
                                    t = t + (decimalCall.UserIndex - 19) / 10.0f;
                                    TempData td = new TempData();
                                    td._Caller = intCall.caller;
                                    td._CallInTime = decimalCall.callin_time;//整数的时间
                                    td._Temperature = t;
                                    td._ErrFlag = 0;
                                    if (NewTempData[CombinationDataIndex] != null)
                                    {
                                        NewTempData[CombinationDataIndex](td);
                                    }
                                    sb = new StringBuilder();
                                    sb.Append("---------------组合温度，无纠错-------------------");
                                    sb.Append("\r\n");
                                    sb.Append(decimalCall.caller);
                                    sb.Append("\r\n");
                                    sb.Append(t.ToString());
                                    sb.Append("\r\n");
                                    sb.Append(decimalCall.callin_time.ToString());
                                    sb.Append("\r\n");
                                    sb.Append("----------------------------------------------");
                                    ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                                    ShowTextLogProc1(decimalCall.caller, sb.ToString());
                                    intCalls.RemoveAt(k);
                                    //检测整数部分
                                    CheckIntCall(ref intCalls, decimalCall.callin_time, CombinationDataIndex);
                                    saveOldTempData[CombinationDataIndex] = new OldTempData();
                                    saveOldTempData[CombinationDataIndex].Caller = intCall.caller;
                                    saveOldTempData[CombinationDataIndex].CallInTime = decimalCall.callin_time;//小数的时间
                                    saveOldTempData[CombinationDataIndex].Temperature = t;
                                    saveOldTempData[CombinationDataIndex].ErrFlag = 0;

                                    curOldTempData[CombinationDataIndex] = saveOldTempData[CombinationDataIndex];
                                    //OldTempDataDBOption.SavwOldTemp(oldtd);
                                    //OldTemp[td._Caller] = td;//保存旧温度
                                    bSave = true;
                                    //IntCalls[decimalCall.caller] = intCalls;
                                    //处理呼叫数据
                                    //List<CallData> noticeCalls = (List<CallData>)NoticeCalls[decimalCall.caller];
                                    if (noticeCalls != null)//有呼叫号
                                    {
                                        for (int n = 0; n < noticeCalls.Count; n++)
                                        {
                                            CallData noticeCall = noticeCalls[n];
                                            //小数温度点的时间应位于呼叫号的时间之后的120s内
                                            if (noticeCall.callin_time < decimalCall.callin_time)
                                            {
                                                if (noticeCall.callin_time.AddSeconds(600) > decimalCall.callin_time)
                                                {
                                                    if (NewCallData[CombinationDataIndex] != null)
                                                    {
                                                        NewCallData[CombinationDataIndex](td);
                                                    }
                                                    noticeCalls.RemoveAt(n);
                                                    sb = new StringBuilder();
                                                    sb.Append("---------------组合呼叫数据-------------------");
                                                    sb.Append("\r\n");
                                                    sb.Append(decimalCall.caller);
                                                    sb.Append("\r\n");
                                                    sb.Append(t.ToString());
                                                    sb.Append("\r\n");
                                                    sb.Append(decimalCall.callin_time.ToString());
                                                    sb.Append("\r\n");
                                                    sb.Append("----------------------------------------------");
                                                    ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                                                    ShowTextLogProc1(decimalCall.caller, sb.ToString());
                                                    //检测呼叫号
                                                    CheckNoticeCall(ref noticeCalls, noticeCall.callin_time);
                                                    //NoticeCalls[decimalCall.caller] = noticeCalls;
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    if (!bSave)//只有小数的容错
                    {
                        //OldTempData oldTd = OldTempDataDBOption.GetOldTemp(decimalCall.caller);//= (TempData)OldTemp[decimalCall.caller];
                        if (curOldTempData[CombinationDataIndex] != null)
                        {
                            float t = curOldTempData[CombinationDataIndex].Temperature;
                            DateTime date = curOldTempData[CombinationDataIndex].CallInTime;
                            if (date.AddHours(5) > decimalCall.callin_time)//两次温度间隔小于5小时
                            {
                                if (date.AddSeconds(200) > decimalCall.callin_time)//200s的重试呼入
                                {
                                    sb = new StringBuilder();
                                    sb.Append("---------------放弃200s内的重试呼入小数-------------------");
                                    sb.Append("\r\n");
                                    sb.Append(decimalCall.caller);
                                    sb.Append("\r\n");
                                    sb.Append("上次呼入时间:");
                                    sb.Append(date.ToString());
                                    sb.Append("\r\n");
                                    sb.Append("本次呼入时间:");
                                    sb.Append(decimalCall.callin_time.ToString());
                                    sb.Append("\r\n");
                                    sb.Append("----------------------------------------------");
                                    ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                                    ShowTextLogProc1(decimalCall.caller, sb.ToString());
                                }
                                else
                                {
                                    int oldInt = (int)t;
                                    float t1, t2, t3;
                                    t1 = oldInt + (decimalCall.UserIndex - 19) / 10.0f;
                                    t2 = oldInt + 1 + (decimalCall.UserIndex - 19) / 10.0f;
                                    t3 = oldInt - 1 + (decimalCall.UserIndex - 19) / 10.0f;
                                    float t11, t22, t33;
                                    t11 = Math.Abs(t1 - curOldTempData[CombinationDataIndex].Temperature);
                                    t22 = Math.Abs(t2 - curOldTempData[CombinationDataIndex].Temperature);
                                    t33 = Math.Abs(t3 - curOldTempData[CombinationDataIndex].Temperature);
                                    float tmin = Math.Min(t11, Math.Min(t22, t33));
                                    if (tmin == t11)
                                        t = t1;
                                    else if (tmin == t22)
                                        t = t2;
                                    else
                                        t = t3;
                                    TempData td = new TempData();
                                    td._Caller = decimalCall.caller;
                                    td._CallInTime = decimalCall.callin_time;//整数的时间
                                    td._Temperature = t;
                                    td._ErrFlag = 2;
                                    //存储数据
                                    if (NewTempData[CombinationDataIndex] != null)
                                    {
                                        NewTempData[CombinationDataIndex](td);
                                    }
                                    sb = new StringBuilder();
                                    sb.Append("---------------组合温度，只有小数的容错，整数超过400s-------------------");
                                    sb.Append("\r\n");
                                    sb.Append(decimalCall.caller);
                                    sb.Append("\r\n");
                                    sb.Append(t.ToString());
                                    sb.Append("\r\n");
                                    sb.Append(decimalCall.callin_time.ToString());
                                    sb.Append("\r\n");
                                    sb.Append("----------------------------------------------");
                                    ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                                    ShowTextLogProc1(decimalCall.caller, sb.ToString());
                                    //检测整数部分
                                    CheckIntCall(ref intCalls, decimalCall.callin_time, CombinationDataIndex);
                                    //                             OldTempData oldtd = new OldTempData();
                                    //                             oldtd.Caller = decimalCall.caller;
                                    //                             oldtd.CallInTime = decimalCall.callin_time;//整数的时间
                                    //                             oldtd.Temperature = t;
                                    //                             oldtd.ErrFlag = 2;
                                    //                             OldTempDataDBOption.SavwOldTemp(oldtd);
                                    saveOldTempData[CombinationDataIndex] = new OldTempData();
                                    saveOldTempData[CombinationDataIndex].Caller = decimalCall.caller;
                                    saveOldTempData[CombinationDataIndex].CallInTime = decimalCall.callin_time;//小数的时间
                                    saveOldTempData[CombinationDataIndex].Temperature = t;
                                    saveOldTempData[CombinationDataIndex].ErrFlag = 0;

                                    curOldTempData[CombinationDataIndex] = saveOldTempData[CombinationDataIndex];
                                }
                            }
                            else
                            {
                                sb = new StringBuilder();
                                sb.Append("---------------放弃小数，历史温度间隔超过5小时--------");
                                sb.Append("\r\n");
                                sb.Append(decimalCall.caller);
                                sb.Append("\r\n");
                                sb.Append((decimalCall.UserIndex - 19).ToString());
                                sb.Append("\r\n");
                                sb.Append(decimalCall.callin_time.ToString());
                                sb.Append("\r\n");
                                sb.Append("历史数据时间");
                                sb.Append(date.ToString());
                                sb.Append("\r\n");
                                sb.Append("----------------------------------------------");
                                ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                                ShowTextLogProc1(decimalCall.caller, sb.ToString());
                            }
                        }
                        else
                        {
                            sb = new StringBuilder();
                            sb.Append("---------------放弃小数，没有历史温度---------");
                            sb.Append("\r\n");
                            sb.Append(decimalCall.caller);
                            sb.Append("\r\n");
                            sb.Append((decimalCall.UserIndex - 19).ToString());
                            sb.Append("\r\n");
                            sb.Append(decimalCall.callin_time.ToString());
                            sb.Append("\r\n");
                            sb.Append("----------------------------------------------");
                            ShowTextLogProc(sb.ToString(), CombinationDataIndex);
                            ShowTextLogProc1(decimalCall.caller, sb.ToString());
                        }
                    }
                    decimalCalls.RemoveAt(index);
                }
                if (decimalCalls.Count != 0)
                {
                    CombinationDataList[CombinationDataIndex].decimalCalls = new CallData[decimalCalls.Count];
                    decimalCalls.CopyTo(CombinationDataList[CombinationDataIndex].decimalCalls);
                }
                else
                    CombinationDataList[CombinationDataIndex].decimalCalls = null;

                if (intCalls != null && intCalls.Count != 0)
                {
                    CombinationDataList[CombinationDataIndex].intCalls = new CallData[intCalls.Count];
                    intCalls.CopyTo(CombinationDataList[CombinationDataIndex].intCalls);
                }
                else
                    CombinationDataList[CombinationDataIndex].intCalls = null;
                if (noticeCalls != null && noticeCalls.Count != 0)
                {
                    CombinationDataList[CombinationDataIndex].noticeCalls = new CallData[noticeCalls.Count];
                    noticeCalls.CopyTo(CombinationDataList[CombinationDataIndex].noticeCalls);
                }
                else
                    CombinationDataList[CombinationDataIndex].noticeCalls = null;
                CombinationThreadWorked[CombinationDataIndex] = false;
            }
            catch (System.Exception ex)
            {
                ShowTextLogProc("组数线程" + data.ToString() + "发生重要错误" + ex.Message, 0);
            }
        }
        void CheckNoticeCall(ref List<CallData> noticeCalls, DateTime endTime)
        {
            bool bOK = false;
            while (!bOK)
            {
                bOK = true;
                for (int i = 0; i < noticeCalls.Count; i++)
                {
                    CallData noticeCall = noticeCalls[i];
                    //有整数部分的呼入时间比现在正组合的整数温度时间还早，则容错
                    if (noticeCall.callin_time < endTime)
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.Append("---------------放弃呼叫数据-------------------");
                        sb.Append("\r\n");
                        sb.Append(noticeCall.caller);
                        sb.Append("\r\n");
                        sb.Append(noticeCall.callin_time.ToString());
                        sb.Append("\r\n");
                        sb.Append("判断时间点:" + noticeCall.callin_time.ToString());
                        sb.Append("\r\n");
                        sb.Append("----------------------------------------------");
                        ShowTextLogProc(sb.ToString(), 1);
                        ShowTextLogProc1(noticeCall.caller, sb.ToString());
                        noticeCalls.RemoveAt(i);
                        bOK = false;
                        break;
                    }
                }
            }
        }
        public DateTime FirstIntCheckTime;
        void CheckIntCall(ref List<CallData> intCalls, DateTime endTime, int index)
        {
            CheckIntCall(ref intCalls, endTime, index, true);
        }
        void CheckIntCall(ref List<CallData> intCalls, DateTime endTime, int index, bool bCom)
        {
            if (intCalls == null)
                return;
            bool bOK = false;
            StringBuilder sb;
            while (!bOK)
            {
                bOK = true;
                for (int i = 0; i < intCalls.Count; i++)
                {
                    CallData intCall = intCalls[i];
                    //有整数部分的呼入时间比现在正组合的整数温度时间还早，则容错
                    if (intCall.callin_time < endTime)
                    {
                        if (bCom)
                        {
                            if (endTime.AddSeconds(-200) > intCall.callin_time)//200s之外，有效，进行容错
                            {
                                IntCallCom(intCall, index, endTime);
                            }
                            else
                            {
                                sb = new StringBuilder();
                                sb.Append("---------------放弃200s内的重试呼入整数数据-------------------");
                                sb.Append("\r\n");
                                sb.Append(intCall.caller);
                                sb.Append("\r\n");
                                sb.Append("排查时间:");
                                sb.Append(endTime.ToString());
                                sb.Append("\r\n");
                                sb.Append("本次呼入时间:");
                                sb.Append(intCall.callin_time.ToString());
                                sb.Append("\r\n");
                                sb.Append("----------------------------------------------");
                                ShowTextLogProc(sb.ToString(), index);
                                ShowTextLogProc1(intCall.caller, sb.ToString());
                            }
                        }
                        else
                        {
                            IntCallCom(intCall, index, endTime);
                        }
                        intCalls.RemoveAt(i);
                        bOK = false;
                        break;
                    }
                }
            }
        }
        void IntCallCom(CallData intCall, int index, DateTime endTime)
        {
            StringBuilder sb = new StringBuilder();
            OldTempData oldTd = OldTempDataDBOption.GetOldTemp(intCall.caller);//= (TempData)OldTemp[intCall.caller];
            if (oldTd != null)
            {
                DateTime date = oldTd.CallInTime;
                //5小时内有效
                if (date.AddHours(5) > intCall.callin_time)
                {
                    float t = oldTd.Temperature;
                    int newInt = intCall.UserIndex + 11;
                    int oldInt = (int)t;
                    int delta = newInt - oldInt;
                    if (delta > 1)
                    {
                        t = newInt + 0.0f;
                    }
                    else if (delta > 0)
                    {
                        t = newInt + 0.2f;
                    }
                    else if (delta < -1)
                    {
                        t = newInt + 0.9f;
                    }
                    else if (delta < 0)
                    {
                        t = newInt + 0.8f;
                    }
                    else//整数部分相等
                    {
                        int h1 = date.Hour;
                        int h2 = intCall.callin_time.Hour;
                        DateTime dd = date;
                        t = t - oldInt;
                        while (true)
                        {
                            dd = dd.AddHours(1);
                            if (dd >= intCall.callin_time)
                            {
                                break;
                            }
                            else
                            {
                                if (dd.Hour < 3 || dd.Hour > 15)
                                    t = t - 0.1f;
                                else
                                    t = t + 0.1f;
                            }
                        }
                        float t1 = newInt + t;
                        h1 = (int)t1;
                        if (h1 != newInt)
                        {
                            t = newInt + 0.0f;
                        }
                        else
                        {
                            t = t1;
                        }
                    }
                    //存储数据
                    TempData td = new TempData();
                    td._Caller = intCall.caller;
                    td._CallInTime = intCall.callin_time;//整数的时间
                    td._Temperature = t;
                    td._ErrFlag = 1;
                    //存储数据
                    if (NewTempData[index] != null)
                    {
                        NewTempData[index](td);
                    }
                    OldTempData oldtd = new OldTempData();
                    oldtd.Caller = intCall.caller;
                    oldtd.CallInTime = intCall.callin_time;//整数的时间
                    oldtd.Temperature = t;
                    oldtd.ErrFlag = 1;
                    OldTempDataDBOption.SavwOldTemp(oldtd);
                    //OldTemp[td._Caller] = td;//保存旧温度  
                    sb = new StringBuilder();
                    sb.Append("---------------组合温度，只有整数容错-------------------");
                    sb.Append("\r\n");
                    sb.Append(intCall.caller);
                    sb.Append("\r\n");
                    sb.Append(t.ToString());
                    sb.Append("\r\n");
                    sb.Append("整数部分到达时间" + intCall.callin_time.ToString());
                    sb.Append("\r\n");
                    sb.Append("排查时间" + endTime.ToString());
                    sb.Append("\r\n");
                    sb.Append("上次温度时间" + oldTd.CallInTime.ToString());
                    sb.Append("\r\n");
                    sb.Append("----------------------------------------------");
                    ShowTextLogProc(sb.ToString(), index);
                    ShowTextLogProc1(intCall.caller, sb.ToString());
                }
                else
                {
                    sb = new StringBuilder();
                    sb.Append("---------------放弃整数部分，历史温度间隔超过5小时-------------------");
                    sb.Append("\r\n");
                    sb.Append(intCall.caller);
                    sb.Append("\r\n");
                    sb.Append((intCall.UserIndex + 11).ToString());
                    sb.Append("\r\n");
                    sb.Append(intCall.callin_time.ToString());
                    sb.Append("\r\n");
                    sb.Append(oldTd.CallInTime.ToString());
                    sb.Append("\r\n");
                    sb.Append("----------------------------------------------");
                    ShowTextLogProc(sb.ToString(), index);
                    ShowTextLogProc1(intCall.caller, sb.ToString());
                }
            }
            else
            {
                sb = new StringBuilder();
                sb.Append("---------------放弃整数部分，没有历史温度-------------------");
                sb.Append("\r\n");
                sb.Append(intCall.caller);
                sb.Append("\r\n");
                sb.Append((intCall.UserIndex + 11).ToString());
                sb.Append("\r\n");
                sb.Append(intCall.callin_time.ToString());
                sb.Append("\r\n");
                sb.Append("----------------------------------------------");
                ShowTextLogProc(sb.ToString(), index);
                ShowTextLogProc1(intCall.caller, sb.ToString());
            }
        }
    }
}
